package org.example.erp.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

import lombok.Data;

/**
 * 库区管理表
 * @TableName warehouse_area
 */
@TableName(value ="warehouse_area")
@Data
public class WarehouseArea implements Serializable {
    /**
     * 库区编号
     */
    @TableId(type = IdType.AUTO)
    private Integer warehouseAreaId;

    /**
     * 库区编码
     */
    private String warehouseAreaCode;

    /**
     * 库区名称
     */
    private String warehouseAreaName;

    /**
     * 面积
     */
    private BigDecimal area;

    /**
     * 仓库id
     */
    private Integer warehouseId;

    /**
     * 备注
     */
    private String remark;

    @TableField(exist = false)
    private List<WarehouseLocation> warehouseLocations;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        WarehouseArea other = (WarehouseArea) that;
        return (this.getWarehouseAreaId() == null ? other.getWarehouseAreaId() == null : this.getWarehouseAreaId().equals(other.getWarehouseAreaId()))
            && (this.getWarehouseAreaCode() == null ? other.getWarehouseAreaCode() == null : this.getWarehouseAreaCode().equals(other.getWarehouseAreaCode()))
            && (this.getWarehouseAreaName() == null ? other.getWarehouseAreaName() == null : this.getWarehouseAreaName().equals(other.getWarehouseAreaName()))
            && (this.getArea() == null ? other.getArea() == null : this.getArea().equals(other.getArea()))
            && (this.getWarehouseId() == null ? other.getWarehouseId() == null : this.getWarehouseId().equals(other.getWarehouseId()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getWarehouseAreaId() == null) ? 0 : getWarehouseAreaId().hashCode());
        result = prime * result + ((getWarehouseAreaCode() == null) ? 0 : getWarehouseAreaCode().hashCode());
        result = prime * result + ((getWarehouseAreaName() == null) ? 0 : getWarehouseAreaName().hashCode());
        result = prime * result + ((getArea() == null) ? 0 : getArea().hashCode());
        result = prime * result + ((getWarehouseId() == null) ? 0 : getWarehouseId().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", warehouseAreaId=").append(warehouseAreaId);
        sb.append(", warehouseAreaCode=").append(warehouseAreaCode);
        sb.append(", warehouseAreaName=").append(warehouseAreaName);
        sb.append(", area=").append(area);
        sb.append(", warehouseId=").append(warehouseId);
        sb.append(", remark=").append(remark);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}